#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <assert.h>

int
slow_lookup(const int what, const int *a, const int n)
{
	register int i = 0;
	while (i < n) {
		if (what == a[i])
			return 1; //found
		else
			++i;
	}
	return 0; //not found
}

int
main(int argc, char **argv)
{
	int first[100], second[100], n, m;
	int i = 0;

	scanf("%d", &n);
	for (; i < n; i++)
		scanf("%d", &first[i]);
	scanf("%d", &m);
	for (i = 0; i < m; i++)
		scanf("%d", &second[i]);

	for (i = 0; i < n; i++)
		if (!slow_lookup(first[i], second, m))
			printf("%d ", first[i]);
	putchar('\n');

	return 0;
}
